package user

import (
	"net/http"

	"github.com/gin-gonic/gin"

	"gitee.com/little_xiang_admin/go-web-api/controller"
	"gitee.com/little_xiang_admin/go-web-api/models/user_info"
	userService1 "gitee.com/little_xiang_admin/go-web-api/services/userService"
)

type UserController struct {
	controller.BaseController
}

func (u UserController) Login(ctx *gin.Context) {

	// 这里要写登陆业务逻辑
	u.ResponseJson(ctx, http.StatusOK, 0, "login success", nil)
}

func (u UserController) Register(ctx *gin.Context) {

	var userService userService1.UserService
	var userInfo user_info.UserInfo

	userInfo.UserName = ctx.PostForm("userName")
	userInfo.Password = ctx.Param("password")
	userInfo.NickName = ctx.Param("nickName")
	userInfo.Email = ctx.Param("email")
	userInfo.Mobile = ctx.Param("mobile")
	userInfo.UserId = "1234"
	userService.UserInfo = &userInfo
	userService.Register()
}
